
_Soft_UART_Write_Text:

;tric.c,64 :: 		void Soft_UART_Write_Text(char* testo) {
;tric.c,66 :: 		for (cnt=0; cnt<strlen(testo); cnt++) {
	CLRF        Soft_UART_Write_Text_cnt_L0+0 
L_Soft_UART_Write_Text0:
	MOVF        FARG_Soft_UART_Write_Text_testo+0, 0 
	MOVWF       FARG_strlen_s+0 
	MOVF        FARG_Soft_UART_Write_Text_testo+1, 0 
	MOVWF       FARG_strlen_s+1 
	CALL        _strlen+0, 0
	MOVLW       128
	MOVWF       R2 
	MOVLW       128
	XORWF       R1, 0 
	SUBWF       R2, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L__Soft_UART_Write_Text97
	MOVF        R0, 0 
	SUBWF       Soft_UART_Write_Text_cnt_L0+0, 0 
L__Soft_UART_Write_Text97:
	BTFSC       STATUS+0, 0 
	GOTO        L_Soft_UART_Write_Text1
;tric.c,67 :: 		Soft_UART_Write(testo[cnt]);
	MOVF        Soft_UART_Write_Text_cnt_L0+0, 0 
	ADDWF       FARG_Soft_UART_Write_Text_testo+0, 0 
	MOVWF       FSR0L 
	MOVLW       0
	ADDWFC      FARG_Soft_UART_Write_Text_testo+1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       FARG_Soft_UART_Write_udata+0 
	CALL        _Soft_UART_Write+0, 0
;tric.c,66 :: 		for (cnt=0; cnt<strlen(testo); cnt++) {
	INCF        Soft_UART_Write_Text_cnt_L0+0, 1 
;tric.c,68 :: 		}
	GOTO        L_Soft_UART_Write_Text0
L_Soft_UART_Write_Text1:
;tric.c,69 :: 		}
	RETURN      0
; end of _Soft_UART_Write_Text

_ADXL345_Wr:

;tric.c,73 :: 		void ADXL345_Wr(unsigned short address, unsigned short in) {
;tric.c,74 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;tric.c,75 :: 		I2C1_Wr(0x3A);      // Write mode
	MOVLW       58
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;tric.c,76 :: 		I2C1_Wr(address);
	MOVF        FARG_ADXL345_Wr_address+0, 0 
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;tric.c,77 :: 		I2C1_Wr(in);
	MOVF        FARG_ADXL345_Wr_in+0, 0 
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;tric.c,78 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;tric.c,79 :: 		}
	RETURN      0
; end of _ADXL345_Wr

_ADXL345_Rd:

;tric.c,83 :: 		unsigned short ADXL345_Rd(unsigned short address) {
;tric.c,85 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;tric.c,86 :: 		I2C1_Wr(0x3A);      // Write mode
	MOVLW       58
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;tric.c,87 :: 		I2C1_Wr(address);
	MOVF        FARG_ADXL345_Rd_address+0, 0 
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;tric.c,88 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;tric.c,89 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;tric.c,90 :: 		I2C1_Wr(0x3B);      // Read Mode
	MOVLW       59
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;tric.c,91 :: 		out = I2C1_Rd(0);
	CLRF        FARG_I2C1_Rd_ack+0 
	CALL        _I2C1_Rd+0, 0
	MOVF        R0, 0 
	MOVWF       ADXL345_Rd_out_L0+0 
;tric.c,92 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;tric.c,93 :: 		return out;
	MOVF        ADXL345_Rd_out_L0+0, 0 
	MOVWF       R0 
;tric.c,94 :: 		}
	RETURN      0
; end of _ADXL345_Rd

_ADXL345_getAcc:

;tric.c,100 :: 		void ADXL345_getAcc(int *acc) {
;tric.c,105 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;tric.c,106 :: 		I2C1_Wr(0x3A);      // Write mode
	MOVLW       58
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;tric.c,107 :: 		I2C1_Wr(0x32);
	MOVLW       50
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;tric.c,108 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;tric.c,109 :: 		I2C1_Start();
	CALL        _I2C1_Start+0, 0
;tric.c,110 :: 		I2C1_Wr(0x3B);      // Read Mode
	MOVLW       59
	MOVWF       FARG_I2C1_Wr_data_+0 
	CALL        _I2C1_Wr+0, 0
;tric.c,111 :: 		for (cnt=0; cnt<6; cnt++) {
	CLRF        ADXL345_getAcc_cnt_L0+0 
L_ADXL345_getAcc3:
	MOVLW       6
	SUBWF       ADXL345_getAcc_cnt_L0+0, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_ADXL345_getAcc4
;tric.c,113 :: 		ack = (cnt<5);
	MOVLW       5
	SUBWF       ADXL345_getAcc_cnt_L0+0, 0 
	MOVLW       1
	BTFSC       STATUS+0, 0 
	MOVLW       0
	MOVWF       FARG_I2C1_Rd_ack+0 
;tric.c,114 :: 		acc_tmp[cnt] = I2C1_Rd(ack);
	MOVLW       ADXL345_getAcc_acc_tmp_L0+0
	MOVWF       FLOC__ADXL345_getAcc+0 
	MOVLW       hi_addr(ADXL345_getAcc_acc_tmp_L0+0)
	MOVWF       FLOC__ADXL345_getAcc+1 
	MOVF        ADXL345_getAcc_cnt_L0+0, 0 
	ADDWF       FLOC__ADXL345_getAcc+0, 1 
	BTFSC       STATUS+0, 0 
	INCF        FLOC__ADXL345_getAcc+1, 1 
	CALL        _I2C1_Rd+0, 0
	MOVFF       FLOC__ADXL345_getAcc+0, FSR1L
	MOVFF       FLOC__ADXL345_getAcc+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
;tric.c,111 :: 		for (cnt=0; cnt<6; cnt++) {
	INCF        ADXL345_getAcc_cnt_L0+0, 1 
;tric.c,115 :: 		}
	GOTO        L_ADXL345_getAcc3
L_ADXL345_getAcc4:
;tric.c,116 :: 		I2C1_Stop();
	CALL        _I2C1_Stop+0, 0
;tric.c,118 :: 		acc[0] = acc_tmp[1];
	MOVFF       FARG_ADXL345_getAcc_acc+0, FSR1L
	MOVFF       FARG_ADXL345_getAcc_acc+1, FSR1H
	MOVF        ADXL345_getAcc_acc_tmp_L0+1, 0 
	MOVWF       POSTINC1+0 
	MOVLW       0
	MOVWF       POSTINC1+0 
;tric.c,119 :: 		acc[0] = acc[0] << 8;
	MOVFF       FARG_ADXL345_getAcc_acc+0, FSR0L
	MOVFF       FARG_ADXL345_getAcc_acc+1, FSR0H
	MOVF        POSTINC0+0, 0 
	MOVWF       R3 
	MOVF        POSTINC0+0, 0 
	MOVWF       R4 
	MOVF        R3, 0 
	MOVWF       R1 
	CLRF        R0 
	MOVFF       FARG_ADXL345_getAcc_acc+0, FSR1L
	MOVFF       FARG_ADXL345_getAcc_acc+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
;tric.c,120 :: 		acc[0] |= acc_tmp[0];
	MOVFF       FARG_ADXL345_getAcc_acc+0, FSR0L
	MOVFF       FARG_ADXL345_getAcc_acc+1, FSR0H
	MOVF        POSTINC0+0, 0 
	MOVWF       R0 
	MOVF        POSTINC0+0, 0 
	MOVWF       R1 
	MOVF        ADXL345_getAcc_acc_tmp_L0+0, 0 
	IORWF       R0, 1 
	MOVLW       0
	IORWF       R1, 1 
	MOVFF       FARG_ADXL345_getAcc_acc+0, FSR1L
	MOVFF       FARG_ADXL345_getAcc_acc+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
;tric.c,121 :: 		acc[1] = acc_tmp[3];
	MOVLW       2
	ADDWF       FARG_ADXL345_getAcc_acc+0, 0 
	MOVWF       FSR1L 
	MOVLW       0
	ADDWFC      FARG_ADXL345_getAcc_acc+1, 0 
	MOVWF       FSR1H 
	MOVF        ADXL345_getAcc_acc_tmp_L0+3, 0 
	MOVWF       POSTINC1+0 
	MOVLW       0
	MOVWF       POSTINC1+0 
;tric.c,122 :: 		acc[1] = acc[1] << 8;
	MOVLW       2
	ADDWF       FARG_ADXL345_getAcc_acc+0, 0 
	MOVWF       FSR1L 
	MOVLW       0
	ADDWFC      FARG_ADXL345_getAcc_acc+1, 0 
	MOVWF       FSR1H 
	MOVLW       2
	ADDWF       FARG_ADXL345_getAcc_acc+0, 0 
	MOVWF       FSR0L 
	MOVLW       0
	ADDWFC      FARG_ADXL345_getAcc_acc+1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       R3 
	MOVF        POSTINC0+0, 0 
	MOVWF       R4 
	MOVF        R3, 0 
	MOVWF       R1 
	CLRF        R0 
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
;tric.c,123 :: 		acc[1] |= acc_tmp[2];
	MOVLW       2
	ADDWF       FARG_ADXL345_getAcc_acc+0, 0 
	MOVWF       R2 
	MOVLW       0
	ADDWFC      FARG_ADXL345_getAcc_acc+1, 0 
	MOVWF       R3 
	MOVFF       R2, FSR0L
	MOVFF       R3, FSR0H
	MOVF        POSTINC0+0, 0 
	MOVWF       R0 
	MOVF        POSTINC0+0, 0 
	MOVWF       R1 
	MOVF        ADXL345_getAcc_acc_tmp_L0+2, 0 
	IORWF       R0, 1 
	MOVLW       0
	IORWF       R1, 1 
	MOVFF       R2, FSR1L
	MOVFF       R3, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
;tric.c,124 :: 		acc[2] = acc_tmp[5];
	MOVLW       4
	ADDWF       FARG_ADXL345_getAcc_acc+0, 0 
	MOVWF       FSR1L 
	MOVLW       0
	ADDWFC      FARG_ADXL345_getAcc_acc+1, 0 
	MOVWF       FSR1H 
	MOVF        ADXL345_getAcc_acc_tmp_L0+5, 0 
	MOVWF       POSTINC1+0 
	MOVLW       0
	MOVWF       POSTINC1+0 
;tric.c,125 :: 		acc[2] = acc[2] << 8;
	MOVLW       4
	ADDWF       FARG_ADXL345_getAcc_acc+0, 0 
	MOVWF       FSR1L 
	MOVLW       0
	ADDWFC      FARG_ADXL345_getAcc_acc+1, 0 
	MOVWF       FSR1H 
	MOVLW       4
	ADDWF       FARG_ADXL345_getAcc_acc+0, 0 
	MOVWF       FSR0L 
	MOVLW       0
	ADDWFC      FARG_ADXL345_getAcc_acc+1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       R3 
	MOVF        POSTINC0+0, 0 
	MOVWF       R4 
	MOVF        R3, 0 
	MOVWF       R1 
	CLRF        R0 
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
;tric.c,126 :: 		acc[2] |= acc_tmp[4];
	MOVLW       4
	ADDWF       FARG_ADXL345_getAcc_acc+0, 0 
	MOVWF       R2 
	MOVLW       0
	ADDWFC      FARG_ADXL345_getAcc_acc+1, 0 
	MOVWF       R3 
	MOVFF       R2, FSR0L
	MOVFF       R3, FSR0H
	MOVF        POSTINC0+0, 0 
	MOVWF       R0 
	MOVF        POSTINC0+0, 0 
	MOVWF       R1 
	MOVF        ADXL345_getAcc_acc_tmp_L0+4, 0 
	IORWF       R0, 1 
	MOVLW       0
	IORWF       R1, 1 
	MOVFF       R2, FSR1L
	MOVFF       R3, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
;tric.c,127 :: 		}
	RETURN      0
; end of _ADXL345_getAcc

_SENSORS_queue_init:

;tric.c,131 :: 		void SENSORS_queue_init() {
;tric.c,134 :: 		for (cnt=0; cnt<SENSORS_table_dim; cnt++) {
	CLRF        SENSORS_queue_init_cnt_L0+0 
L_SENSORS_queue_init6:
	MOVLW       16
	SUBWF       SENSORS_queue_init_cnt_L0+0, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_SENSORS_queue_init7
;tric.c,135 :: 		ADXL345_getAcc(&SENSORS_acceleration_now);
	MOVLW       SENSORS_queue_init_SENSORS_acceleration_now_L0+0
	MOVWF       FARG_ADXL345_getAcc_acc+0 
	MOVLW       hi_addr(SENSORS_queue_init_SENSORS_acceleration_now_L0+0)
	MOVWF       FARG_ADXL345_getAcc_acc+1 
	CALL        _ADXL345_getAcc+0, 0
;tric.c,136 :: 		SENSORS_table_x[cnt] = SENSORS_acceleration_now[0];
	MOVF        SENSORS_queue_init_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       _SENSORS_table_x+0
	ADDWF       R0, 0 
	MOVWF       FSR1L 
	MOVLW       hi_addr(_SENSORS_table_x+0)
	ADDWFC      R1, 0 
	MOVWF       FSR1H 
	MOVF        SENSORS_queue_init_SENSORS_acceleration_now_L0+0, 0 
	MOVWF       POSTINC1+0 
	MOVF        SENSORS_queue_init_SENSORS_acceleration_now_L0+1, 0 
	MOVWF       POSTINC1+0 
;tric.c,137 :: 		SENSORS_table_y[cnt] = SENSORS_acceleration_now[1];
	MOVF        SENSORS_queue_init_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       _SENSORS_table_y+0
	ADDWF       R0, 0 
	MOVWF       FSR1L 
	MOVLW       hi_addr(_SENSORS_table_y+0)
	ADDWFC      R1, 0 
	MOVWF       FSR1H 
	MOVF        SENSORS_queue_init_SENSORS_acceleration_now_L0+2, 0 
	MOVWF       POSTINC1+0 
	MOVF        SENSORS_queue_init_SENSORS_acceleration_now_L0+3, 0 
	MOVWF       POSTINC1+0 
;tric.c,138 :: 		SENSORS_table_z[cnt] = SENSORS_acceleration_now[2];
	MOVF        SENSORS_queue_init_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       _SENSORS_table_z+0
	ADDWF       R0, 0 
	MOVWF       FSR1L 
	MOVLW       hi_addr(_SENSORS_table_z+0)
	ADDWFC      R1, 0 
	MOVWF       FSR1H 
	MOVF        SENSORS_queue_init_SENSORS_acceleration_now_L0+4, 0 
	MOVWF       POSTINC1+0 
	MOVF        SENSORS_queue_init_SENSORS_acceleration_now_L0+5, 0 
	MOVWF       POSTINC1+0 
;tric.c,139 :: 		Delay_ms(2);
	MOVLW       32
	MOVWF       R12, 0
	MOVLW       41
	MOVWF       R13, 0
L_SENSORS_queue_init9:
	DECFSZ      R13, 1, 1
	BRA         L_SENSORS_queue_init9
	DECFSZ      R12, 1, 1
	BRA         L_SENSORS_queue_init9
	NOP
	NOP
;tric.c,134 :: 		for (cnt=0; cnt<SENSORS_table_dim; cnt++) {
	INCF        SENSORS_queue_init_cnt_L0+0, 1 
;tric.c,140 :: 		}
	GOTO        L_SENSORS_queue_init6
L_SENSORS_queue_init7:
;tric.c,141 :: 		}
	RETURN      0
; end of _SENSORS_queue_init

_SENSORS_queue_update:

;tric.c,145 :: 		void SENSORS_queue_update() {
;tric.c,148 :: 		if (SENSORS_table_pointer < 0 || SENSORS_table_pointer >= SENSORS_table_dim) SENSORS_table_pointer = 0;
	MOVLW       0
	SUBWF       SENSORS_queue_update_SENSORS_table_pointer_L0+0, 0 
	BTFSS       STATUS+0, 0 
	GOTO        L__SENSORS_queue_update96
	MOVLW       16
	SUBWF       SENSORS_queue_update_SENSORS_table_pointer_L0+0, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L__SENSORS_queue_update96
	GOTO        L_SENSORS_queue_update12
L__SENSORS_queue_update96:
	CLRF        SENSORS_queue_update_SENSORS_table_pointer_L0+0 
L_SENSORS_queue_update12:
;tric.c,149 :: 		ADXL345_getAcc(&acc_tmp);
	MOVLW       SENSORS_queue_update_acc_tmp_L0+0
	MOVWF       FARG_ADXL345_getAcc_acc+0 
	MOVLW       hi_addr(SENSORS_queue_update_acc_tmp_L0+0)
	MOVWF       FARG_ADXL345_getAcc_acc+1 
	CALL        _ADXL345_getAcc+0, 0
;tric.c,150 :: 		SENSORS_table_x[SENSORS_table_pointer] = acc_tmp[0];
	MOVF        SENSORS_queue_update_SENSORS_table_pointer_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       _SENSORS_table_x+0
	ADDWF       R0, 0 
	MOVWF       FSR1L 
	MOVLW       hi_addr(_SENSORS_table_x+0)
	ADDWFC      R1, 0 
	MOVWF       FSR1H 
	MOVF        SENSORS_queue_update_acc_tmp_L0+0, 0 
	MOVWF       POSTINC1+0 
	MOVF        SENSORS_queue_update_acc_tmp_L0+1, 0 
	MOVWF       POSTINC1+0 
;tric.c,151 :: 		SENSORS_table_y[SENSORS_table_pointer] = acc_tmp[1];
	MOVF        SENSORS_queue_update_SENSORS_table_pointer_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       _SENSORS_table_y+0
	ADDWF       R0, 0 
	MOVWF       FSR1L 
	MOVLW       hi_addr(_SENSORS_table_y+0)
	ADDWFC      R1, 0 
	MOVWF       FSR1H 
	MOVF        SENSORS_queue_update_acc_tmp_L0+2, 0 
	MOVWF       POSTINC1+0 
	MOVF        SENSORS_queue_update_acc_tmp_L0+3, 0 
	MOVWF       POSTINC1+0 
;tric.c,152 :: 		SENSORS_table_z[SENSORS_table_pointer] = acc_tmp[2];
	MOVF        SENSORS_queue_update_SENSORS_table_pointer_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       _SENSORS_table_z+0
	ADDWF       R0, 0 
	MOVWF       FSR1L 
	MOVLW       hi_addr(_SENSORS_table_z+0)
	ADDWFC      R1, 0 
	MOVWF       FSR1H 
	MOVF        SENSORS_queue_update_acc_tmp_L0+4, 0 
	MOVWF       POSTINC1+0 
	MOVF        SENSORS_queue_update_acc_tmp_L0+5, 0 
	MOVWF       POSTINC1+0 
;tric.c,153 :: 		SENSORS_table_pointer++;
	INCF        SENSORS_queue_update_SENSORS_table_pointer_L0+0, 1 
;tric.c,154 :: 		}
	RETURN      0
; end of _SENSORS_queue_update

_SENSORS_queue_filter:

;tric.c,158 :: 		int SENSORS_queue_filter(int *fifo) {
;tric.c,160 :: 		long value = 0;
	CLRF        SENSORS_queue_filter_value_L0+0 
	CLRF        SENSORS_queue_filter_value_L0+1 
	CLRF        SENSORS_queue_filter_value_L0+2 
	CLRF        SENSORS_queue_filter_value_L0+3 
;tric.c,161 :: 		for (cnt=0; cnt<SENSORS_table_dim; cnt++) {
	CLRF        R5 
L_SENSORS_queue_filter13:
	MOVLW       16
	SUBWF       R5, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_SENSORS_queue_filter14
;tric.c,162 :: 		value += fifo[cnt];
	MOVF        R5, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVF        R0, 0 
	ADDWF       FARG_SENSORS_queue_filter_fifo+0, 0 
	MOVWF       FSR2L 
	MOVF        R1, 0 
	ADDWFC      FARG_SENSORS_queue_filter_fifo+1, 0 
	MOVWF       FSR2H 
	MOVF        POSTINC2+0, 0 
	MOVWF       R0 
	MOVF        POSTINC2+0, 0 
	MOVWF       R1 
	MOVF        R0, 0 
	ADDWF       SENSORS_queue_filter_value_L0+0, 1 
	MOVF        R1, 0 
	ADDWFC      SENSORS_queue_filter_value_L0+1, 1 
	MOVLW       0
	BTFSC       R1, 7 
	MOVLW       255
	ADDWFC      SENSORS_queue_filter_value_L0+2, 1 
	ADDWFC      SENSORS_queue_filter_value_L0+3, 1 
;tric.c,161 :: 		for (cnt=0; cnt<SENSORS_table_dim; cnt++) {
	INCF        R5, 1 
;tric.c,163 :: 		}
	GOTO        L_SENSORS_queue_filter13
L_SENSORS_queue_filter14:
;tric.c,164 :: 		return (int)(value/SENSORS_table_dim);
	MOVLW       4
	MOVWF       R4 
	MOVF        SENSORS_queue_filter_value_L0+0, 0 
	MOVWF       R0 
	MOVF        SENSORS_queue_filter_value_L0+1, 0 
	MOVWF       R1 
	MOVF        SENSORS_queue_filter_value_L0+2, 0 
	MOVWF       R2 
	MOVF        SENSORS_queue_filter_value_L0+3, 0 
	MOVWF       R3 
	MOVF        R4, 0 
L__SENSORS_queue_filter98:
	BZ          L__SENSORS_queue_filter99
	RRCF        R3, 1 
	RRCF        R2, 1 
	RRCF        R1, 1 
	RRCF        R0, 1 
	BCF         R3, 7 
	BTFSC       R3, 6 
	BSF         R3, 7 
	ADDLW       255
	GOTO        L__SENSORS_queue_filter98
L__SENSORS_queue_filter99:
;tric.c,165 :: 		}
	RETURN      0
; end of _SENSORS_queue_filter

_MOTORS_ctrl:

;tric.c,167 :: 		void MOTORS_ctrl() {
;tric.c,170 :: 		MOTORS_speed_max = 0;
	CLRF        R2 
;tric.c,171 :: 		THREAD_counts = 0;
	CLRF        _THREAD_counts+0 
;tric.c,172 :: 		for(cnt=0; cnt<4; cnt++) {
	CLRF        R1 
L_MOTORS_ctrl16:
	MOVLW       4
	SUBWF       R1, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_MOTORS_ctrl17
;tric.c,173 :: 		if(MOTORS_speed[cnt] > MOTORS_top_speed) MOTORS_speed[cnt] = MOTORS_top_speed;
	MOVLW       _MOTORS_speed+0
	MOVWF       FSR0L 
	MOVLW       hi_addr(_MOTORS_speed+0)
	MOVWF       FSR0H 
	MOVF        R1, 0 
	ADDWF       FSR0L, 1 
	BTFSC       STATUS+0, 0 
	INCF        FSR0H, 1 
	MOVF        POSTINC0+0, 0 
	SUBLW       95
	BTFSC       STATUS+0, 0 
	GOTO        L_MOTORS_ctrl19
	MOVLW       _MOTORS_speed+0
	MOVWF       FSR1L 
	MOVLW       hi_addr(_MOTORS_speed+0)
	MOVWF       FSR1H 
	MOVF        R1, 0 
	ADDWF       FSR1L, 1 
	BTFSC       STATUS+0, 0 
	INCF        FSR1H, 1 
	MOVLW       95
	MOVWF       POSTINC1+0 
L_MOTORS_ctrl19:
;tric.c,174 :: 		MOTORS_speed_max = (MOTORS_speed[cnt] >= MOTORS_speed_max) ? MOTORS_speed[cnt] : MOTORS_speed_max;
	MOVLW       _MOTORS_speed+0
	MOVWF       FSR0L 
	MOVLW       hi_addr(_MOTORS_speed+0)
	MOVWF       FSR0H 
	MOVF        R1, 0 
	ADDWF       FSR0L, 1 
	BTFSC       STATUS+0, 0 
	INCF        FSR0H, 1 
	MOVF        R2, 0 
	SUBWF       POSTINC0+0, 0 
	BTFSS       STATUS+0, 0 
	GOTO        L_MOTORS_ctrl20
	MOVLW       _MOTORS_speed+0
	MOVWF       FSR0L 
	MOVLW       hi_addr(_MOTORS_speed+0)
	MOVWF       FSR0H 
	MOVF        R1, 0 
	ADDWF       FSR0L, 1 
	BTFSC       STATUS+0, 0 
	INCF        FSR0H, 1 
	MOVF        POSTINC0+0, 0 
	MOVWF       R0 
	GOTO        L_MOTORS_ctrl21
L_MOTORS_ctrl20:
	MOVF        R2, 0 
	MOVWF       R0 
L_MOTORS_ctrl21:
	MOVF        R0, 0 
	MOVWF       R2 
;tric.c,172 :: 		for(cnt=0; cnt<4; cnt++) {
	INCF        R1, 1 
;tric.c,175 :: 		}
	GOTO        L_MOTORS_ctrl16
L_MOTORS_ctrl17:
;tric.c,176 :: 		for(cnt=0; cnt<=MOTORS_speed_max; cnt++) {
	CLRF        R1 
L_MOTORS_ctrl22:
	MOVF        R1, 0 
	SUBWF       R2, 0 
	BTFSS       STATUS+0, 0 
	GOTO        L_MOTORS_ctrl23
;tric.c,177 :: 		if(cnt == MOTORS_speed[0]) MOTORS_M1 = 1;
	MOVF        R1, 0 
	XORWF       _MOTORS_speed+0, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L_MOTORS_ctrl25
	BSF         PORTC+0, 0 
L_MOTORS_ctrl25:
;tric.c,178 :: 		if(cnt == MOTORS_speed[1]) MOTORS_M2 = 1;
	MOVF        R1, 0 
	XORWF       _MOTORS_speed+1, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L_MOTORS_ctrl26
	BSF         PORTC+0, 1 
L_MOTORS_ctrl26:
;tric.c,179 :: 		if(cnt == MOTORS_speed[2]) MOTORS_M3 = 1;
	MOVF        R1, 0 
	XORWF       _MOTORS_speed+2, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L_MOTORS_ctrl27
	BSF         PORTC+0, 6 
L_MOTORS_ctrl27:
;tric.c,180 :: 		if(cnt == MOTORS_speed[3]) MOTORS_MS = 1;
	MOVF        R1, 0 
	XORWF       _MOTORS_speed+3, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L_MOTORS_ctrl28
	BSF         PORTC+0, 7 
L_MOTORS_ctrl28:
;tric.c,181 :: 		Delay_us(8);
	MOVLW       31
	MOVWF       R13, 0
L_MOTORS_ctrl29:
	DECFSZ      R13, 1, 1
	BRA         L_MOTORS_ctrl29
	NOP
	NOP
;tric.c,176 :: 		for(cnt=0; cnt<=MOTORS_speed_max; cnt++) {
	INCF        R1, 1 
;tric.c,182 :: 		}
	GOTO        L_MOTORS_ctrl22
L_MOTORS_ctrl23:
;tric.c,183 :: 		}
	RETURN      0
; end of _MOTORS_ctrl

_ESC_startup:

;tric.c,188 :: 		void ESC_startup(){
;tric.c,189 :: 		unsigned short cnt=0;
	CLRF        ESC_startup_cnt_L0+0 
;tric.c,190 :: 		while(cnt<200) {
L_ESC_startup30:
	MOVLW       200
	SUBWF       ESC_startup_cnt_L0+0, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_ESC_startup31
;tric.c,191 :: 		MOTORS_M1 = 0;
	BCF         PORTC+0, 0 
;tric.c,192 :: 		MOTORS_M2 = 0;
	BCF         PORTC+0, 1 
;tric.c,193 :: 		MOTORS_M3 = 0;
	BCF         PORTC+0, 6 
;tric.c,194 :: 		Delay_ms(1);
	MOVLW       16
	MOVWF       R12, 0
	MOVLW       148
	MOVWF       R13, 0
L_ESC_startup32:
	DECFSZ      R13, 1, 1
	BRA         L_ESC_startup32
	DECFSZ      R12, 1, 1
	BRA         L_ESC_startup32
	NOP
;tric.c,195 :: 		MOTORS_M1 = 1;
	BSF         PORTC+0, 0 
;tric.c,196 :: 		MOTORS_M2 = 1;
	BSF         PORTC+0, 1 
;tric.c,197 :: 		MOTORS_M3 = 1;
	BSF         PORTC+0, 6 
;tric.c,198 :: 		Delay_ms(20);
	MOVLW       2
	MOVWF       R11, 0
	MOVLW       56
	MOVWF       R12, 0
	MOVLW       173
	MOVWF       R13, 0
L_ESC_startup33:
	DECFSZ      R13, 1, 1
	BRA         L_ESC_startup33
	DECFSZ      R12, 1, 1
	BRA         L_ESC_startup33
	DECFSZ      R11, 1, 1
	BRA         L_ESC_startup33
;tric.c,199 :: 		cnt++;
	INCF        ESC_startup_cnt_L0+0, 1 
;tric.c,200 :: 		}
	GOTO        L_ESC_startup30
L_ESC_startup31:
;tric.c,201 :: 		T0CON.TMR0ON=1;
	BSF         T0CON+0, 7 
;tric.c,202 :: 		}
	RETURN      0
; end of _ESC_startup

_ESC_config:

;tric.c,208 :: 		void ESC_config(){
;tric.c,209 :: 		unsigned short cnt=0;
	CLRF        ESC_config_cnt_L0+0 
;tric.c,210 :: 		while(cnt<150) {
L_ESC_config34:
	MOVLW       150
	SUBWF       ESC_config_cnt_L0+0, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_ESC_config35
;tric.c,211 :: 		MOTORS_M1 = 0;
	BCF         PORTC+0, 0 
;tric.c,212 :: 		MOTORS_M2 = 0;
	BCF         PORTC+0, 1 
;tric.c,213 :: 		MOTORS_M3 = 0;
	BCF         PORTC+0, 6 
;tric.c,214 :: 		Delay_ms(2);
	MOVLW       32
	MOVWF       R12, 0
	MOVLW       41
	MOVWF       R13, 0
L_ESC_config36:
	DECFSZ      R13, 1, 1
	BRA         L_ESC_config36
	DECFSZ      R12, 1, 1
	BRA         L_ESC_config36
	NOP
	NOP
;tric.c,215 :: 		MOTORS_M1 = 1;
	BSF         PORTC+0, 0 
;tric.c,216 :: 		MOTORS_M2 = 1;
	BSF         PORTC+0, 1 
;tric.c,217 :: 		MOTORS_M3 = 1;
	BSF         PORTC+0, 6 
;tric.c,218 :: 		Delay_ms(20);
	MOVLW       2
	MOVWF       R11, 0
	MOVLW       56
	MOVWF       R12, 0
	MOVLW       173
	MOVWF       R13, 0
L_ESC_config37:
	DECFSZ      R13, 1, 1
	BRA         L_ESC_config37
	DECFSZ      R12, 1, 1
	BRA         L_ESC_config37
	DECFSZ      R11, 1, 1
	BRA         L_ESC_config37
;tric.c,219 :: 		cnt++;
	INCF        ESC_config_cnt_L0+0, 1 
;tric.c,220 :: 		}
	GOTO        L_ESC_config34
L_ESC_config35:
;tric.c,221 :: 		cnt = 0;
	CLRF        ESC_config_cnt_L0+0 
;tric.c,222 :: 		while(cnt<150) {
L_ESC_config38:
	MOVLW       150
	SUBWF       ESC_config_cnt_L0+0, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_ESC_config39
;tric.c,223 :: 		MOTORS_M1 = 0;
	BCF         PORTC+0, 0 
;tric.c,224 :: 		MOTORS_M2 = 0;
	BCF         PORTC+0, 1 
;tric.c,225 :: 		MOTORS_M3 = 0;
	BCF         PORTC+0, 6 
;tric.c,226 :: 		Delay_ms(1);
	MOVLW       16
	MOVWF       R12, 0
	MOVLW       148
	MOVWF       R13, 0
L_ESC_config40:
	DECFSZ      R13, 1, 1
	BRA         L_ESC_config40
	DECFSZ      R12, 1, 1
	BRA         L_ESC_config40
	NOP
;tric.c,227 :: 		MOTORS_M1 = 1;
	BSF         PORTC+0, 0 
;tric.c,228 :: 		MOTORS_M2 = 1;
	BSF         PORTC+0, 1 
;tric.c,229 :: 		MOTORS_M3 = 1;
	BSF         PORTC+0, 6 
;tric.c,230 :: 		Delay_ms(20);
	MOVLW       2
	MOVWF       R11, 0
	MOVLW       56
	MOVWF       R12, 0
	MOVLW       173
	MOVWF       R13, 0
L_ESC_config41:
	DECFSZ      R13, 1, 1
	BRA         L_ESC_config41
	DECFSZ      R12, 1, 1
	BRA         L_ESC_config41
	DECFSZ      R11, 1, 1
	BRA         L_ESC_config41
;tric.c,231 :: 		cnt++;
	INCF        ESC_config_cnt_L0+0, 1 
;tric.c,232 :: 		}
	GOTO        L_ESC_config38
L_ESC_config39:
;tric.c,233 :: 		Delay_ms(2000);
	MOVLW       122
	MOVWF       R11, 0
	MOVLW       193
	MOVWF       R12, 0
	MOVLW       129
	MOVWF       R13, 0
L_ESC_config42:
	DECFSZ      R13, 1, 1
	BRA         L_ESC_config42
	DECFSZ      R12, 1, 1
	BRA         L_ESC_config42
	DECFSZ      R11, 1, 1
	BRA         L_ESC_config42
	NOP
	NOP
;tric.c,234 :: 		}
	RETURN      0
; end of _ESC_config

_SENSORS_update:

;tric.c,240 :: 		void SENSORS_update(){
;tric.c,241 :: 		SENSORS_queue_update();
	CALL        _SENSORS_queue_update+0, 0
;tric.c,242 :: 		SENSORS_acceleration[0] = SENSORS_queue_filter(&SENSORS_table_x);
	MOVLW       _SENSORS_table_x+0
	MOVWF       FARG_SENSORS_queue_filter_fifo+0 
	MOVLW       hi_addr(_SENSORS_table_x+0)
	MOVWF       FARG_SENSORS_queue_filter_fifo+1 
	CALL        _SENSORS_queue_filter+0, 0
	MOVF        R0, 0 
	MOVWF       _SENSORS_acceleration+0 
	MOVF        R1, 0 
	MOVWF       _SENSORS_acceleration+1 
;tric.c,243 :: 		SENSORS_acceleration[1] = SENSORS_queue_filter(&SENSORS_table_y);
	MOVLW       _SENSORS_table_y+0
	MOVWF       FARG_SENSORS_queue_filter_fifo+0 
	MOVLW       hi_addr(_SENSORS_table_y+0)
	MOVWF       FARG_SENSORS_queue_filter_fifo+1 
	CALL        _SENSORS_queue_filter+0, 0
	MOVF        R0, 0 
	MOVWF       _SENSORS_acceleration+2 
	MOVF        R1, 0 
	MOVWF       _SENSORS_acceleration+3 
;tric.c,244 :: 		SENSORS_acceleration[2] = SENSORS_queue_filter(&SENSORS_table_z);
	MOVLW       _SENSORS_table_z+0
	MOVWF       FARG_SENSORS_queue_filter_fifo+0 
	MOVLW       hi_addr(_SENSORS_table_z+0)
	MOVWF       FARG_SENSORS_queue_filter_fifo+1 
	CALL        _SENSORS_queue_filter+0, 0
	MOVF        R0, 0 
	MOVWF       _SENSORS_acceleration+4 
	MOVF        R1, 0 
	MOVWF       _SENSORS_acceleration+5 
;tric.c,245 :: 		}
	RETURN      0
; end of _SENSORS_update

_RX_speedPercent:

;tric.c,247 :: 		void RX_speedPercent(){
;tric.c,250 :: 		for(cnt=0; cnt<4; cnt++) {
	CLRF        RX_speedPercent_cnt_L0+0 
L_RX_speedPercent43:
	MOVLW       4
	SUBWF       RX_speedPercent_cnt_L0+0, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_RX_speedPercent44
;tric.c,254 :: 		RX_temp = (float)(RX_values[cnt]) * 0.5;    // calc percent
	MOVLW       _RX_values+0
	MOVWF       FSR0L 
	MOVLW       hi_addr(_RX_values+0)
	MOVWF       FSR0H 
	MOVF        RX_speedPercent_cnt_L0+0, 0 
	ADDWF       FSR0L, 1 
	BTFSC       STATUS+0, 0 
	INCF        FSR0H, 1 
	MOVF        POSTINC0+0, 0 
	MOVWF       R0 
	CALL        _Byte2Double+0, 0
	MOVLW       0
	MOVWF       R4 
	MOVLW       0
	MOVWF       R5 
	MOVLW       0
	MOVWF       R6 
	MOVLW       126
	MOVWF       R7 
	CALL        _Mul_32x32_FP+0, 0
;tric.c,255 :: 		MOTORS_speed[cnt] = floor(RX_temp);
	MOVLW       _MOTORS_speed+0
	MOVWF       FLOC__RX_speedPercent+0 
	MOVLW       hi_addr(_MOTORS_speed+0)
	MOVWF       FLOC__RX_speedPercent+1 
	MOVF        RX_speedPercent_cnt_L0+0, 0 
	ADDWF       FLOC__RX_speedPercent+0, 1 
	BTFSC       STATUS+0, 0 
	INCF        FLOC__RX_speedPercent+1, 1 
	MOVF        R0, 0 
	MOVWF       FARG_floor_x+0 
	MOVF        R1, 0 
	MOVWF       FARG_floor_x+1 
	MOVF        R2, 0 
	MOVWF       FARG_floor_x+2 
	MOVF        R3, 0 
	MOVWF       FARG_floor_x+3 
	CALL        _floor+0, 0
	CALL        _Double2Byte+0, 0
	MOVFF       FLOC__RX_speedPercent+0, FSR1L
	MOVFF       FLOC__RX_speedPercent+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
;tric.c,250 :: 		for(cnt=0; cnt<4; cnt++) {
	INCF        RX_speedPercent_cnt_L0+0, 1 
;tric.c,259 :: 		}
	GOTO        L_RX_speedPercent43
L_RX_speedPercent44:
;tric.c,260 :: 		}
	RETURN      0
; end of _RX_speedPercent

_PID_update:

;tric.c,266 :: 		void PID_update() {
;tric.c,274 :: 		for (cnt=0; cnt<3; cnt++) {
	CLRF        PID_update_cnt_L0+0 
L_PID_update46:
	MOVLW       3
	SUBWF       PID_update_cnt_L0+0, 0 
	BTFSC       STATUS+0, 0 
	GOTO        L_PID_update47
;tric.c,276 :: 		PID_err_proportional[cnt] = RX_values[cnt] - SENSORS_acceleration[cnt];  // Need to be implemented conversion between RX and SENSORS values!!!
	MOVF        PID_update_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       PID_update_PID_err_proportional_L0+0
	ADDWF       R0, 0 
	MOVWF       FLOC__PID_update+0 
	MOVLW       hi_addr(PID_update_PID_err_proportional_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FLOC__PID_update+1 
	MOVLW       _RX_values+0
	MOVWF       FSR0L 
	MOVLW       hi_addr(_RX_values+0)
	MOVWF       FSR0H 
	MOVF        PID_update_cnt_L0+0, 0 
	ADDWF       FSR0L, 1 
	BTFSC       STATUS+0, 0 
	INCF        FSR0H, 1 
	MOVF        PID_update_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       _SENSORS_acceleration+0
	ADDWF       R0, 0 
	MOVWF       FSR2L 
	MOVLW       hi_addr(_SENSORS_acceleration+0)
	ADDWFC      R1, 0 
	MOVWF       FSR2H 
	MOVF        POSTINC2+0, 0 
	SUBWF       POSTINC0+0, 0 
	MOVWF       R0 
	MOVF        POSTINC2+0, 0 
	MOVWF       R1 
	MOVLW       0
	SUBFWB      R1, 1 
	CALL        _Int2Double+0, 0
	MOVFF       FLOC__PID_update+0, FSR1L
	MOVFF       FLOC__PID_update+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
	MOVF        R2, 0 
	MOVWF       POSTINC1+0 
	MOVF        R3, 0 
	MOVWF       POSTINC1+0 
;tric.c,277 :: 		if(abs(PID_err_proportional[cnt]) > PID_err_integral_min) PID_err_integral[cnt] += PID_err_proportional[cnt] * PID_timeslice;
	MOVF        PID_update_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       PID_update_PID_err_proportional_L0+0
	ADDWF       R0, 0 
	MOVWF       FSR0L 
	MOVLW       hi_addr(PID_update_PID_err_proportional_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       R0 
	MOVF        POSTINC0+0, 0 
	MOVWF       R1 
	MOVF        POSTINC0+0, 0 
	MOVWF       R2 
	MOVF        POSTINC0+0, 0 
	MOVWF       R3 
	CALL        _Double2Int+0, 0
	MOVF        R0, 0 
	MOVWF       FARG_abs_a+0 
	MOVF        R1, 0 
	MOVWF       FARG_abs_a+1 
	CALL        _abs+0, 0
	CALL        _Int2Double+0, 0
	MOVF        R0, 0 
	MOVWF       R4 
	MOVF        R1, 0 
	MOVWF       R5 
	MOVF        R2, 0 
	MOVWF       R6 
	MOVF        R3, 0 
	MOVWF       R7 
	MOVLW       10
	MOVWF       R0 
	MOVLW       215
	MOVWF       R1 
	MOVLW       35
	MOVWF       R2 
	MOVLW       120
	MOVWF       R3 
	CALL        _Compare_Double+0, 0
	MOVLW       1
	BTFSC       STATUS+0, 0 
	MOVLW       0
	MOVWF       R0 
	MOVF        R0, 1 
	BTFSC       STATUS+0, 2 
	GOTO        L_PID_update49
	MOVF        PID_update_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       PID_update_PID_err_integral_L0+0
	ADDWF       R0, 0 
	MOVWF       FLOC__PID_update+0 
	MOVLW       hi_addr(PID_update_PID_err_integral_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FLOC__PID_update+1 
	MOVLW       PID_update_PID_err_proportional_L0+0
	ADDWF       R0, 0 
	MOVWF       FSR0L 
	MOVLW       hi_addr(PID_update_PID_err_proportional_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       R0 
	MOVF        POSTINC0+0, 0 
	MOVWF       R1 
	MOVF        POSTINC0+0, 0 
	MOVWF       R2 
	MOVF        POSTINC0+0, 0 
	MOVWF       R3 
	MOVLW       111
	MOVWF       R4 
	MOVLW       18
	MOVWF       R5 
	MOVLW       3
	MOVWF       R6 
	MOVLW       118
	MOVWF       R7 
	CALL        _Mul_32x32_FP+0, 0
	MOVFF       FLOC__PID_update+0, FSR0L
	MOVFF       FLOC__PID_update+1, FSR0H
	MOVF        POSTINC0+0, 0 
	MOVWF       R4 
	MOVF        POSTINC0+0, 0 
	MOVWF       R5 
	MOVF        POSTINC0+0, 0 
	MOVWF       R6 
	MOVF        POSTINC0+0, 0 
	MOVWF       R7 
	CALL        _Add_32x32_FP+0, 0
	MOVFF       FLOC__PID_update+0, FSR1L
	MOVFF       FLOC__PID_update+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
	MOVF        R2, 0 
	MOVWF       POSTINC1+0 
	MOVF        R3, 0 
	MOVWF       POSTINC1+0 
L_PID_update49:
;tric.c,278 :: 		PID_err_derivative[cnt] = (PID_err_proportional[cnt] - PID_err_proportional_old[cnt]) / PID_timeslice;
	MOVF        PID_update_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       PID_update_PID_err_derivative_L0+0
	ADDWF       R0, 0 
	MOVWF       FLOC__PID_update+0 
	MOVLW       hi_addr(PID_update_PID_err_derivative_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FLOC__PID_update+1 
	MOVLW       PID_update_PID_err_proportional_L0+0
	ADDWF       R0, 0 
	MOVWF       FSR0L 
	MOVLW       hi_addr(PID_update_PID_err_proportional_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       R8 
	MOVF        POSTINC0+0, 0 
	MOVWF       R9 
	MOVF        POSTINC0+0, 0 
	MOVWF       R10 
	MOVF        POSTINC0+0, 0 
	MOVWF       R11 
	MOVLW       PID_update_PID_err_proportional_old_L0+0
	ADDWF       R0, 0 
	MOVWF       FSR2L 
	MOVLW       hi_addr(PID_update_PID_err_proportional_old_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FSR2H 
	MOVF        POSTINC2+0, 0 
	MOVWF       R4 
	MOVF        POSTINC2+0, 0 
	MOVWF       R5 
	MOVF        POSTINC2+0, 0 
	MOVWF       R6 
	MOVF        POSTINC2+0, 0 
	MOVWF       R7 
	MOVF        R8, 0 
	MOVWF       R0 
	MOVF        R9, 0 
	MOVWF       R1 
	MOVF        R10, 0 
	MOVWF       R2 
	MOVF        R11, 0 
	MOVWF       R3 
	CALL        _Sub_32x32_FP+0, 0
	MOVLW       111
	MOVWF       R4 
	MOVLW       18
	MOVWF       R5 
	MOVLW       3
	MOVWF       R6 
	MOVLW       118
	MOVWF       R7 
	CALL        _Div_32x32_FP+0, 0
	MOVFF       FLOC__PID_update+0, FSR1L
	MOVFF       FLOC__PID_update+1, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
	MOVF        R2, 0 
	MOVWF       POSTINC1+0 
	MOVF        R3, 0 
	MOVWF       POSTINC1+0 
;tric.c,279 :: 		PID_output[cnt] = (int)( (PID_Kp*PID_err_proportional[cnt]) + (PID_Ki*PID_err_integral[cnt]) + (PID_Kd*PID_err_derivative[cnt]) );
	MOVF        PID_update_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       PID_update_PID_output_L0+0
	ADDWF       R0, 0 
	MOVWF       FLOC__PID_update+6 
	MOVLW       hi_addr(PID_update_PID_output_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FLOC__PID_update+7 
	MOVF        PID_update_cnt_L0+0, 0 
	MOVWF       FLOC__PID_update+4 
	MOVLW       0
	MOVWF       FLOC__PID_update+5 
	RLCF        FLOC__PID_update+4, 1 
	BCF         FLOC__PID_update+4, 0 
	RLCF        FLOC__PID_update+5, 1 
	RLCF        FLOC__PID_update+4, 1 
	BCF         FLOC__PID_update+4, 0 
	RLCF        FLOC__PID_update+5, 1 
	MOVLW       PID_update_PID_err_proportional_L0+0
	ADDWF       FLOC__PID_update+4, 0 
	MOVWF       FSR2L 
	MOVLW       hi_addr(PID_update_PID_err_proportional_L0+0)
	ADDWFC      FLOC__PID_update+5, 0 
	MOVWF       FSR2H 
	MOVF        POSTINC2+0, 0 
	MOVWF       R0 
	MOVF        POSTINC2+0, 0 
	MOVWF       R1 
	MOVF        POSTINC2+0, 0 
	MOVWF       R2 
	MOVF        POSTINC2+0, 0 
	MOVWF       R3 
	MOVLW       205
	MOVWF       R4 
	MOVLW       204
	MOVWF       R5 
	MOVLW       76
	MOVWF       R6 
	MOVLW       123
	MOVWF       R7 
	CALL        _Mul_32x32_FP+0, 0
	MOVF        R0, 0 
	MOVWF       FLOC__PID_update+0 
	MOVF        R1, 0 
	MOVWF       FLOC__PID_update+1 
	MOVF        R2, 0 
	MOVWF       FLOC__PID_update+2 
	MOVF        R3, 0 
	MOVWF       FLOC__PID_update+3 
	MOVLW       PID_update_PID_err_integral_L0+0
	ADDWF       FLOC__PID_update+4, 0 
	MOVWF       FSR2L 
	MOVLW       hi_addr(PID_update_PID_err_integral_L0+0)
	ADDWFC      FLOC__PID_update+5, 0 
	MOVWF       FSR2H 
	MOVF        POSTINC2+0, 0 
	MOVWF       R0 
	MOVF        POSTINC2+0, 0 
	MOVWF       R1 
	MOVF        POSTINC2+0, 0 
	MOVWF       R2 
	MOVF        POSTINC2+0, 0 
	MOVWF       R3 
	MOVLW       10
	MOVWF       R4 
	MOVLW       215
	MOVWF       R5 
	MOVLW       35
	MOVWF       R6 
	MOVLW       119
	MOVWF       R7 
	CALL        _Mul_32x32_FP+0, 0
	MOVF        FLOC__PID_update+0, 0 
	MOVWF       R4 
	MOVF        FLOC__PID_update+1, 0 
	MOVWF       R5 
	MOVF        FLOC__PID_update+2, 0 
	MOVWF       R6 
	MOVF        FLOC__PID_update+3, 0 
	MOVWF       R7 
	CALL        _Add_32x32_FP+0, 0
	MOVF        R0, 0 
	MOVWF       FLOC__PID_update+0 
	MOVF        R1, 0 
	MOVWF       FLOC__PID_update+1 
	MOVF        R2, 0 
	MOVWF       FLOC__PID_update+2 
	MOVF        R3, 0 
	MOVWF       FLOC__PID_update+3 
	MOVLW       PID_update_PID_err_derivative_L0+0
	ADDWF       FLOC__PID_update+4, 0 
	MOVWF       FSR2L 
	MOVLW       hi_addr(PID_update_PID_err_derivative_L0+0)
	ADDWFC      FLOC__PID_update+5, 0 
	MOVWF       FSR2H 
	MOVF        POSTINC2+0, 0 
	MOVWF       R0 
	MOVF        POSTINC2+0, 0 
	MOVWF       R1 
	MOVF        POSTINC2+0, 0 
	MOVWF       R2 
	MOVF        POSTINC2+0, 0 
	MOVWF       R3 
	MOVLW       10
	MOVWF       R4 
	MOVLW       215
	MOVWF       R5 
	MOVLW       35
	MOVWF       R6 
	MOVLW       120
	MOVWF       R7 
	CALL        _Mul_32x32_FP+0, 0
	MOVF        FLOC__PID_update+0, 0 
	MOVWF       R4 
	MOVF        FLOC__PID_update+1, 0 
	MOVWF       R5 
	MOVF        FLOC__PID_update+2, 0 
	MOVWF       R6 
	MOVF        FLOC__PID_update+3, 0 
	MOVWF       R7 
	CALL        _Add_32x32_FP+0, 0
	CALL        _Double2Int+0, 0
	MOVFF       FLOC__PID_update+6, FSR1L
	MOVFF       FLOC__PID_update+7, FSR1H
	MOVF        R0, 0 
	MOVWF       POSTINC1+0 
	MOVF        R1, 0 
	MOVWF       POSTINC1+0 
;tric.c,281 :: 		if(PID_output[cnt] > PID_output_max) PID_output[cnt] = PID_output_max;
	MOVF        PID_update_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       PID_update_PID_output_L0+0
	ADDWF       R0, 0 
	MOVWF       FSR0L 
	MOVLW       hi_addr(PID_update_PID_output_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       R1 
	MOVF        POSTINC0+0, 0 
	MOVWF       R2 
	MOVLW       128
	MOVWF       R0 
	MOVLW       128
	XORWF       R2, 0 
	SUBWF       R0, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L__PID_update100
	MOVF        R1, 0 
	SUBLW       100
L__PID_update100:
	BTFSC       STATUS+0, 0 
	GOTO        L_PID_update50
	MOVF        PID_update_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       PID_update_PID_output_L0+0
	ADDWF       R0, 0 
	MOVWF       FSR1L 
	MOVLW       hi_addr(PID_update_PID_output_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FSR1H 
	MOVLW       100
	MOVWF       POSTINC1+0 
	MOVLW       0
	MOVWF       POSTINC1+0 
	GOTO        L_PID_update51
L_PID_update50:
;tric.c,282 :: 		else if(PID_output[cnt] < PID_output_min) PID_output[cnt] = PID_output_min;
	MOVF        PID_update_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       PID_update_PID_output_L0+0
	ADDWF       R0, 0 
	MOVWF       FSR0L 
	MOVLW       hi_addr(PID_update_PID_output_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       R1 
	MOVF        POSTINC0+0, 0 
	MOVWF       R2 
	MOVLW       128
	XORWF       R2, 0 
	MOVWF       R0 
	MOVLW       128
	SUBWF       R0, 0 
	BTFSS       STATUS+0, 2 
	GOTO        L__PID_update101
	MOVLW       0
	SUBWF       R1, 0 
L__PID_update101:
	BTFSC       STATUS+0, 0 
	GOTO        L_PID_update52
	MOVF        PID_update_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       PID_update_PID_output_L0+0
	ADDWF       R0, 0 
	MOVWF       FSR1L 
	MOVLW       hi_addr(PID_update_PID_output_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FSR1H 
	CLRF        POSTINC1+0 
	CLRF        POSTINC1+0 
L_PID_update52:
L_PID_update51:
;tric.c,284 :: 		PID_err_proportional_old[cnt] = PID_err_proportional[cnt];
	MOVF        PID_update_cnt_L0+0, 0 
	MOVWF       R0 
	MOVLW       0
	MOVWF       R1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	RLCF        R0, 1 
	BCF         R0, 0 
	RLCF        R1, 1 
	MOVLW       PID_update_PID_err_proportional_old_L0+0
	ADDWF       R0, 0 
	MOVWF       FSR1L 
	MOVLW       hi_addr(PID_update_PID_err_proportional_old_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FSR1H 
	MOVLW       PID_update_PID_err_proportional_L0+0
	ADDWF       R0, 0 
	MOVWF       FSR0L 
	MOVLW       hi_addr(PID_update_PID_err_proportional_L0+0)
	ADDWFC      R1, 0 
	MOVWF       FSR0H 
	MOVF        POSTINC0+0, 0 
	MOVWF       POSTINC1+0 
	MOVF        POSTINC0+0, 0 
	MOVWF       POSTINC1+0 
	MOVF        POSTINC0+0, 0 
	MOVWF       POSTINC1+0 
	MOVF        POSTINC0+0, 0 
	MOVWF       POSTINC1+0 
;tric.c,274 :: 		for (cnt=0; cnt<3; cnt++) {
	INCF        PID_update_cnt_L0+0, 1 
;tric.c,285 :: 		}
	GOTO        L_PID_update46
L_PID_update47:
;tric.c,286 :: 		MOTORS_speed[0] = PID_output[1] + PID_output[2] - PID_output[0]; // M1 = -X  +Y  +Z
	MOVF        PID_update_PID_output_L0+4, 0 
	ADDWF       PID_update_PID_output_L0+2, 0 
	MOVWF       _MOTORS_speed+0 
	MOVF        PID_update_PID_output_L0+0, 0 
	SUBWF       _MOTORS_speed+0, 1 
;tric.c,287 :: 		MOTORS_speed[1] = PID_output[2] - PID_output[1] - PID_output[1]; // M2 =     -2Y +Z
	MOVF        PID_update_PID_output_L0+2, 0 
	SUBWF       PID_update_PID_output_L0+4, 0 
	MOVWF       _MOTORS_speed+1 
	MOVF        PID_update_PID_output_L0+2, 0 
	SUBWF       _MOTORS_speed+1, 1 
;tric.c,288 :: 		MOTORS_speed[2] = PID_output[0] + PID_output[1] + PID_output[2]; // M3 = +X  +Y  +Z
	MOVF        PID_update_PID_output_L0+2, 0 
	ADDWF       PID_update_PID_output_L0+0, 0 
	MOVWF       _MOTORS_speed+2 
	MOVF        PID_update_PID_output_L0+4, 0 
	ADDWF       _MOTORS_speed+2, 1 
;tric.c,289 :: 		}
	RETURN      0
; end of _PID_update

_main:

;tric.c,296 :: 		void main() {
;tric.c,299 :: 		LED_DIR = 0;         // LED is set as OUTPUT
	BCF         TRISC+0, 2 
;tric.c,300 :: 		MOTORS_M1_DIR = 0;   // M1 is set as OUTPUT
	BCF         TRISC+0, 0 
;tric.c,301 :: 		MOTORS_M2_DIR = 0;   // M2 is set as OUTPUT
	BCF         TRISC+0, 1 
;tric.c,302 :: 		MOTORS_M3_DIR = 0;   // M3 is set as OUTPUT
	BCF         TRISC+0, 6 
;tric.c,303 :: 		MOTORS_MS_DIR = 0;   // MS is set as OUTPUT
	BCF         TRISC+0, 7 
;tric.c,304 :: 		RX1_DIR = 1;
	BSF         TRISB+0, 4 
;tric.c,305 :: 		RX2_DIR = 1;
	BSF         TRISB+0, 5 
;tric.c,306 :: 		RX3_DIR = 1;
	BSF         TRISB+0, 6 
;tric.c,307 :: 		RX4_DIR = 1;
	BSF         TRISB+0, 7 
;tric.c,308 :: 		LED = 0;
	BCF         PORTC+0, 2 
;tric.c,311 :: 		ADCON1 = 0x0F;    // Set A/D Disabled
	MOVLW       15
	MOVWF       ADCON1+0 
;tric.c,312 :: 		CMCON = 0xCF;     // Set Comparator Disabled
	MOVLW       207
	MOVWF       CMCON+0 
;tric.c,317 :: 		DEBUG_DIR = 0;
	BCF         TRISA+0, 0 
;tric.c,318 :: 		Soft_UART_Init(&PORTA, 1, 0, 57600, 0);
	MOVLW       PORTA+0
	MOVWF       FARG_Soft_UART_Init_port+0 
	MOVLW       hi_addr(PORTA+0)
	MOVWF       FARG_Soft_UART_Init_port+1 
	MOVLW       1
	MOVWF       FARG_Soft_UART_Init_rx_pin+0 
	CLRF        FARG_Soft_UART_Init_tx_pin+0 
	MOVLW       0
	MOVWF       FARG_Soft_UART_Init_baud_rate+0 
	MOVLW       225
	MOVWF       FARG_Soft_UART_Init_baud_rate+1 
	MOVLW       0
	MOVWF       FARG_Soft_UART_Init_baud_rate+2 
	MOVWF       FARG_Soft_UART_Init_baud_rate+3 
	CLRF        FARG_Soft_UART_Init_inverted+0 
	CALL        _Soft_UART_Init+0, 0
;tric.c,319 :: 		I2C1_Init(400000);
	MOVLW       30
	MOVWF       SSPADD+0 
	CALL        _I2C1_Init+0, 0
;tric.c,320 :: 		MOTORS_M1 = 1;
	BSF         PORTC+0, 0 
;tric.c,321 :: 		MOTORS_M2 = 1;
	BSF         PORTC+0, 1 
;tric.c,322 :: 		MOTORS_M3 = 1;
	BSF         PORTC+0, 6 
;tric.c,323 :: 		MOTORS_MS = 1;
	BSF         PORTC+0, 7 
;tric.c,324 :: 		Delay_ms(500);
	MOVLW       31
	MOVWF       R11, 0
	MOVLW       113
	MOVWF       R12, 0
	MOVLW       30
	MOVWF       R13, 0
L_main53:
	DECFSZ      R13, 1, 1
	BRA         L_main53
	DECFSZ      R12, 1, 1
	BRA         L_main53
	DECFSZ      R11, 1, 1
	BRA         L_main53
	NOP
;tric.c,328 :: 		ADXL345_Wr(0x2C, 0x0C);      // 400Hz conversion data rate
	MOVLW       44
	MOVWF       FARG_ADXL345_Wr_address+0 
	MOVLW       12
	MOVWF       FARG_ADXL345_Wr_in+0 
	CALL        _ADXL345_Wr+0, 0
;tric.c,329 :: 		ADXL345_Wr(0x2D, 0x08);      // Measuring activated ;)
	MOVLW       45
	MOVWF       FARG_ADXL345_Wr_address+0 
	MOVLW       8
	MOVWF       FARG_ADXL345_Wr_in+0 
	CALL        _ADXL345_Wr+0, 0
;tric.c,330 :: 		ADXL345_Wr(0x31, 0x0B);      // Resolution set to +/- 16g (WOW!)
	MOVLW       49
	MOVWF       FARG_ADXL345_Wr_address+0 
	MOVLW       11
	MOVWF       FARG_ADXL345_Wr_in+0 
	CALL        _ADXL345_Wr+0, 0
;tric.c,331 :: 		Delay_ms(500);
	MOVLW       31
	MOVWF       R11, 0
	MOVLW       113
	MOVWF       R12, 0
	MOVLW       30
	MOVWF       R13, 0
L_main54:
	DECFSZ      R13, 1, 1
	BRA         L_main54
	DECFSZ      R12, 1, 1
	BRA         L_main54
	DECFSZ      R11, 1, 1
	BRA         L_main54
	NOP
;tric.c,334 :: 		T0CON.T0PS0 = 0;     //Prescaler 1:64
	BCF         T0CON+0, 0 
;tric.c,335 :: 		T0CON.T0PS1 = 1;
	BSF         T0CON+0, 1 
;tric.c,336 :: 		T0CON.T0PS2 = 1;
	BSF         T0CON+0, 2 
;tric.c,337 :: 		T0CON.PSA = 1;       // Timer Clock Source is from Prescaler
	BSF         T0CON+0, 3 
;tric.c,338 :: 		T0CON.T0CS = 0;      // Prescaler gets clock from FCPU
	BCF         T0CON+0, 5 
;tric.c,339 :: 		T0CON.T08BIT = 1;    // 8 BIT MODE
	BSF         T0CON+0, 6 
;tric.c,340 :: 		INTCON.TMR0IE = 0;   // Enable TIMER0 Interrupt
	BCF         INTCON+0, 5 
;tric.c,341 :: 		TMR0L = 0;           // TMR0 preset
	CLRF        TMR0L+0 
;tric.c,342 :: 		TMR0H = 0;           // TMR0 preset
	CLRF        TMR0H+0 
;tric.c,343 :: 		INTCON.TMR0IF = 0;
	BCF         INTCON+0, 2 
;tric.c,344 :: 		T0CON.TMR0ON = 0;
	BCF         T0CON+0, 7 
;tric.c,347 :: 		T1CON.T1CKPS1 = 0;        //prescaler 1:0
	BCF         T1CON+0, 5 
;tric.c,348 :: 		T1CON.T1CKPS0 = 0;        //prescaler 1:0   --> 0,33uS per incremento
	BCF         T1CON+0, 4 
;tric.c,349 :: 		INTCON.GIE = 1 ;         //enable global interrupts
	BSF         INTCON+0, 7 
;tric.c,350 :: 		INTCON.PEIE = 1 ;        //PEIE: Peripheral Interrupt Enable bit
	BSF         INTCON+0, 6 
;tric.c,351 :: 		PIE1.TMR1IE = 1  ;        //enable timer 1 interrupt
	BSF         PIE1+0, 0 
;tric.c,352 :: 		TMR1H = 0xD1;            //High byte timer = 0
	MOVLW       209
	MOVWF       TMR1H+0 
;tric.c,353 :: 		TMR1L = 0x80;            //Low  byte timer = 0
	MOVLW       128
	MOVWF       TMR1L+0 
;tric.c,354 :: 		PIR1.TMR1IF = 0 ;        //clear timer 1 interrupt flag
	BCF         PIR1+0, 0 
;tric.c,355 :: 		T1CON.TMR1ON = 1;        //timer 1 start/stop
	BSF         T1CON+0, 0 
;tric.c,358 :: 		INTCON.RBIE = 1; //RB Port Change Interrupt Enable bit (1)
	BSF         INTCON+0, 3 
;tric.c,359 :: 		INTCON.RBIF = 0; //RB Port Change Interrupt Flag bit
	BCF         INTCON+0, 0 
;tric.c,360 :: 		INTCON.INT0IE = 0; //INT0 External Interrupt Enable bit  (1)
	BCF         INTCON+0, 4 
;tric.c,361 :: 		INTCON.INT0IF = 0; //INT0 External Interrupt Flag bit
	BCF         INTCON+0, 1 
;tric.c,365 :: 		THREAD_counts = 0;
	CLRF        _THREAD_counts+0 
;tric.c,366 :: 		THREAD_ready = 0;
	CLRF        _THREAD_ready+0 
;tric.c,367 :: 		MOTORS_speed[0] = 0;
	CLRF        _MOTORS_speed+0 
;tric.c,368 :: 		MOTORS_speed[1] = 0x20;
	MOVLW       32
	MOVWF       _MOTORS_speed+1 
;tric.c,369 :: 		MOTORS_speed[2] = 0x30;
	MOVLW       48
	MOVWF       _MOTORS_speed+2 
;tric.c,370 :: 		MOTORS_speed[3] = 0x60;
	MOVLW       96
	MOVWF       _MOTORS_speed+3 
;tric.c,371 :: 		b_old = PORTB;
	MOVF        PORTB+0, 0 
	MOVWF       _b_old+0 
;tric.c,372 :: 		b_now = PORTB;
	MOVF        PORTB+0, 0 
	MOVWF       _b_now+0 
;tric.c,376 :: 		SENSORS_queue_init();                  // ADXL345 Array filling up
	CALL        _SENSORS_queue_init+0, 0
;tric.c,377 :: 		ESC_config();
	CALL        _ESC_config+0, 0
;tric.c,378 :: 		ESC_startup();
	CALL        _ESC_startup+0, 0
;tric.c,380 :: 		T0CON.TMR0ON = 1;
	BSF         T0CON+0, 7 
;tric.c,382 :: 		while (1) {
L_main55:
;tric.c,383 :: 		if(THREAD_ready){
	MOVF        _THREAD_ready+0, 1 
	BTFSC       STATUS+0, 2 
	GOTO        L_main57
;tric.c,384 :: 		switch(THREAD_counts){
	GOTO        L_main58
;tric.c,385 :: 		case 1:
L_main60:
;tric.c,386 :: 		LED=!LED;
	BTG         PORTC+0, 2 
;tric.c,387 :: 		THREAD_ready = 0;
	CLRF        _THREAD_ready+0 
;tric.c,388 :: 		break;
	GOTO        L_main59
;tric.c,390 :: 		case 20:
L_main61:
;tric.c,391 :: 		MOTORS_M1 = 0;
	BCF         PORTC+0, 0 
;tric.c,392 :: 		MOTORS_M2 = 0;
	BCF         PORTC+0, 1 
;tric.c,393 :: 		MOTORS_M3 = 0;
	BCF         PORTC+0, 6 
;tric.c,394 :: 		MOTORS_MS = 0;
	BCF         PORTC+0, 7 
;tric.c,395 :: 		THREAD_ready = 0;
	CLRF        _THREAD_ready+0 
;tric.c,396 :: 		break;
	GOTO        L_main59
;tric.c,397 :: 		case 0:
L_main62:
;tric.c,398 :: 		case 2:
L_main63:
;tric.c,399 :: 		case 4:
L_main64:
;tric.c,400 :: 		case 6:
L_main65:
;tric.c,401 :: 		case 8:
L_main66:
;tric.c,402 :: 		case 10:
L_main67:
;tric.c,403 :: 		case 12:
L_main68:
;tric.c,404 :: 		case 14:
L_main69:
;tric.c,405 :: 		case 16:
L_main70:
;tric.c,406 :: 		case 18:
L_main71:
;tric.c,407 :: 		RX_speedPercent();
	CALL        _RX_speedPercent+0, 0
;tric.c,408 :: 		SENSORS_update();
	CALL        _SENSORS_update+0, 0
;tric.c,410 :: 		THREAD_ready = 0;
	CLRF        _THREAD_ready+0 
;tric.c,411 :: 		break;
	GOTO        L_main59
;tric.c,413 :: 		case 21:
L_main72:
;tric.c,414 :: 		MOTORS_ctrl();
	CALL        _MOTORS_ctrl+0, 0
;tric.c,415 :: 		THREAD_ready = 0;
	CLRF        _THREAD_ready+0 
;tric.c,416 :: 		break;
	GOTO        L_main59
;tric.c,417 :: 		case 3:
L_main73:
;tric.c,418 :: 		case 5:
L_main74:
;tric.c,419 :: 		case 7:
L_main75:
;tric.c,420 :: 		case 9:
L_main76:
;tric.c,421 :: 		case 11:
L_main77:
;tric.c,422 :: 		case 13:
L_main78:
;tric.c,423 :: 		case 15:
L_main79:
;tric.c,424 :: 		case 17:
L_main80:
;tric.c,425 :: 		case 19:
L_main81:
;tric.c,426 :: 		THREAD_ready = 0;
	CLRF        _THREAD_ready+0 
;tric.c,427 :: 		break;
	GOTO        L_main59
;tric.c,429 :: 		}
L_main58:
	MOVF        _THREAD_counts+0, 0 
	XORLW       1
	BTFSC       STATUS+0, 2 
	GOTO        L_main60
	MOVF        _THREAD_counts+0, 0 
	XORLW       20
	BTFSC       STATUS+0, 2 
	GOTO        L_main61
	MOVF        _THREAD_counts+0, 0 
	XORLW       0
	BTFSC       STATUS+0, 2 
	GOTO        L_main62
	MOVF        _THREAD_counts+0, 0 
	XORLW       2
	BTFSC       STATUS+0, 2 
	GOTO        L_main63
	MOVF        _THREAD_counts+0, 0 
	XORLW       4
	BTFSC       STATUS+0, 2 
	GOTO        L_main64
	MOVF        _THREAD_counts+0, 0 
	XORLW       6
	BTFSC       STATUS+0, 2 
	GOTO        L_main65
	MOVF        _THREAD_counts+0, 0 
	XORLW       8
	BTFSC       STATUS+0, 2 
	GOTO        L_main66
	MOVF        _THREAD_counts+0, 0 
	XORLW       10
	BTFSC       STATUS+0, 2 
	GOTO        L_main67
	MOVF        _THREAD_counts+0, 0 
	XORLW       12
	BTFSC       STATUS+0, 2 
	GOTO        L_main68
	MOVF        _THREAD_counts+0, 0 
	XORLW       14
	BTFSC       STATUS+0, 2 
	GOTO        L_main69
	MOVF        _THREAD_counts+0, 0 
	XORLW       16
	BTFSC       STATUS+0, 2 
	GOTO        L_main70
	MOVF        _THREAD_counts+0, 0 
	XORLW       18
	BTFSC       STATUS+0, 2 
	GOTO        L_main71
	MOVF        _THREAD_counts+0, 0 
	XORLW       21
	BTFSC       STATUS+0, 2 
	GOTO        L_main72
	MOVF        _THREAD_counts+0, 0 
	XORLW       3
	BTFSC       STATUS+0, 2 
	GOTO        L_main73
	MOVF        _THREAD_counts+0, 0 
	XORLW       5
	BTFSC       STATUS+0, 2 
	GOTO        L_main74
	MOVF        _THREAD_counts+0, 0 
	XORLW       7
	BTFSC       STATUS+0, 2 
	GOTO        L_main75
	MOVF        _THREAD_counts+0, 0 
	XORLW       9
	BTFSC       STATUS+0, 2 
	GOTO        L_main76
	MOVF        _THREAD_counts+0, 0 
	XORLW       11
	BTFSC       STATUS+0, 2 
	GOTO        L_main77
	MOVF        _THREAD_counts+0, 0 
	XORLW       13
	BTFSC       STATUS+0, 2 
	GOTO        L_main78
	MOVF        _THREAD_counts+0, 0 
	XORLW       15
	BTFSC       STATUS+0, 2 
	GOTO        L_main79
	MOVF        _THREAD_counts+0, 0 
	XORLW       17
	BTFSC       STATUS+0, 2 
	GOTO        L_main80
	MOVF        _THREAD_counts+0, 0 
	XORLW       19
	BTFSC       STATUS+0, 2 
	GOTO        L_main81
L_main59:
;tric.c,430 :: 		}
L_main57:
;tric.c,431 :: 		}
	GOTO        L_main55
;tric.c,432 :: 		}
	GOTO        $+0
; end of _main

_interrupt:

;tric.c,435 :: 		void interrupt() {
;tric.c,437 :: 		if(INTCON.RBIF){
	BTFSS       INTCON+0, 0 
	GOTO        L_interrupt82
;tric.c,438 :: 		INTCON.RBIE = 0;
	BCF         INTCON+0, 3 
;tric.c,439 :: 		b_now = PORTB;
	MOVF        PORTB+0, 0 
	MOVWF       _b_now+0 
;tric.c,440 :: 		b_and = b_now ^ b_old;
	MOVF        _b_old+0, 0 
	XORWF       _b_now+0, 0 
	MOVWF       R1 
	MOVF        R1, 0 
	MOVWF       _b_and+0 
;tric.c,443 :: 		if(b_and & 0x010) {
	BTFSS       R1, 4 
	GOTO        L_interrupt83
;tric.c,444 :: 		if(b_now & 0x010) {   // Rising  (End)
	BTFSS       _b_now+0, 4 
	GOTO        L_interrupt84
;tric.c,445 :: 		RX_values[0] = (TMR0L - RX_values[0]);
	MOVF        _RX_values+0, 0 
	SUBWF       TMR0L+0, 0 
	MOVWF       _RX_values+0 
;tric.c,448 :: 		} else {             // Falling (Start)
	GOTO        L_interrupt85
L_interrupt84:
;tric.c,450 :: 		RX_values[0] = TMR0L;
	MOVF        TMR0L+0, 0 
	MOVWF       _RX_values+0 
;tric.c,451 :: 		}
L_interrupt85:
;tric.c,452 :: 		}
L_interrupt83:
;tric.c,453 :: 		if(b_and & 0x020) {
	BTFSS       _b_and+0, 5 
	GOTO        L_interrupt86
;tric.c,454 :: 		if(b_now & 0x020) {
	BTFSS       _b_now+0, 5 
	GOTO        L_interrupt87
;tric.c,455 :: 		RX_values[1] = TMR0L - RX_values[1];
	MOVF        _RX_values+1, 0 
	SUBWF       TMR0L+0, 0 
	MOVWF       _RX_values+1 
;tric.c,456 :: 		} else {
	GOTO        L_interrupt88
L_interrupt87:
;tric.c,457 :: 		RX_values[1] = TMR0L;
	MOVF        TMR0L+0, 0 
	MOVWF       _RX_values+1 
;tric.c,458 :: 		}
L_interrupt88:
;tric.c,459 :: 		}
L_interrupt86:
;tric.c,460 :: 		if(b_and & 0x040) {
	BTFSS       _b_and+0, 6 
	GOTO        L_interrupt89
;tric.c,461 :: 		if(b_now & 0x040) {
	BTFSS       _b_now+0, 6 
	GOTO        L_interrupt90
;tric.c,462 :: 		RX_values[2] = TMR0L - RX_values[2];
	MOVF        _RX_values+2, 0 
	SUBWF       TMR0L+0, 0 
	MOVWF       _RX_values+2 
;tric.c,463 :: 		} else {
	GOTO        L_interrupt91
L_interrupt90:
;tric.c,464 :: 		RX_values[2] = TMR0L;
	MOVF        TMR0L+0, 0 
	MOVWF       _RX_values+2 
;tric.c,465 :: 		}
L_interrupt91:
;tric.c,466 :: 		}
L_interrupt89:
;tric.c,467 :: 		if(b_and & 0x080) {
	BTFSS       _b_and+0, 7 
	GOTO        L_interrupt92
;tric.c,468 :: 		if(b_now & 0x080) {
	BTFSS       _b_now+0, 7 
	GOTO        L_interrupt93
;tric.c,469 :: 		RX_values[3] = TMR0L - RX_values[3];
	MOVF        _RX_values+3, 0 
	SUBWF       TMR0L+0, 0 
	MOVWF       _RX_values+3 
;tric.c,470 :: 		} else {
	GOTO        L_interrupt94
L_interrupt93:
;tric.c,471 :: 		RX_values[3] = TMR0L;
	MOVF        TMR0L+0, 0 
	MOVWF       _RX_values+3 
;tric.c,472 :: 		}
L_interrupt94:
;tric.c,473 :: 		}
L_interrupt92:
;tric.c,475 :: 		b_old = b_now;
	MOVF        _b_now+0, 0 
	MOVWF       _b_old+0 
;tric.c,476 :: 		INTCON.RBIF = 0; // Try to remove it to save time
	BCF         INTCON+0, 0 
;tric.c,477 :: 		INTCON.RBIE = 1;
	BSF         INTCON+0, 3 
;tric.c,478 :: 		}//end RBIF interrupt
L_interrupt82:
;tric.c,480 :: 		if(PIR1.TMR1IF) {
	BTFSS       PIR1+0, 0 
	GOTO        L_interrupt95
;tric.c,481 :: 		TMR1H = 0xD1;
	MOVLW       209
	MOVWF       TMR1H+0 
;tric.c,482 :: 		TMR1L = 0x80;
	MOVLW       128
	MOVWF       TMR1L+0 
;tric.c,483 :: 		PIR1.TMR1IF=0;
	BCF         PIR1+0, 0 
;tric.c,484 :: 		THREAD_counts++;
	INCF        _THREAD_counts+0, 1 
;tric.c,485 :: 		THREAD_ready = 1;
	MOVLW       1
	MOVWF       _THREAD_ready+0 
;tric.c,486 :: 		}//end TMR1 interrupt
L_interrupt95:
;tric.c,494 :: 		}
L__interrupt102:
	RETFIE      1
; end of _interrupt
